<!doctype html>
<html>
	<head>
		<title>ch05_04</title>
		<link rel=stylesheet type="text/css" href="color.css">
		<script type="text/javascript">			
			function sendok(){
				var userid = document.getElementById("userid");
				var userpwd = document.getElementById("userpwd");
				if(userid.value != "" && userpwd.value != ""){
					localStorage.userid = userid.value;
					sessionStorage.userpwd = userpwd.value;
					return true;
				}else{
					alert("请输入账号");
					return false;
				}
			}
			function isload(){
				if(localStorage.userid){
					document.getElementById("userid").value = localStorage.userid;
				}
			}
		</script>
	</head>
	<body onload="isload()">
		<img src="images/logo.png" />
		<form method="post" action="ch05_05.html" onsubmit="return sendok();">
			请输入你的账号：<br />
			<input type="text" id="userid" value="guest" autofocus /><br />
			请输入你的密码：<br />
			<input type="password" id="userpwd" value="1234" autofocus /><br />
			<font style="font-size:12px">
				(测试账号：guest 密码：1234)
			</font><br />
			<input id="btn_send" type="submit" value="登录"><br />
		</form>
	</body>
</html>